package com.demoworld;

import com.demoworld.hello.MessagePrinter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * Created by francis on 2017/12/11.
 */
@Configuration
@ComponentScan
public class Startup {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(Startup.class);
        MessagePrinter printer = context.getBean(MessagePrinter.class);
        printer.printMessage();
    }
}
